package com.atguigu03._extends.exer2;

/**
 * ClassName: Cylinder
 * Package: com.atguigu03._extends.exer2
 * Description:
 *
 * @Author xiao_qi
 * @Create 2024/5/10 21:16
 * @Version 1.0
 */
public class Cylinder extends Circle{
    private double length ;//高度

    public void setLength(double length) {
        this.length = length;
    }

    public Cylinder(double radius) {
        super(radius);
        this.length = 1;
    }

    public double getLength() {
        return length;
    }

    //表面积
    public double findArea(){
        return 3.14 * getRadius() * getRadius() * 2 +
                2 * 3.14 * getRadius() * getLength();
    }
    public double findVolume(){
        return findArea()*length;
    }
}
